home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / hlpkey / hlpkey.frm < prev    next >
Text File  |  1995-05-08  |  3KB  |  119 lines

  1. VERSION 2.00
  2. Begin Form Main 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "HLPKEY F1 Hook DEMO"
  5.    ClientHeight    =   2640
  6.    ClientLeft      =   3030
  7.    ClientTop       =   2145
  8.    ClientWidth     =   4095
  9.    Height          =   3045
  10.    Left            =   2970
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   2640
  15.    ScaleWidth      =   4095
  16.    Top             =   1800
  17.    Width           =   4215
  18.    Begin TextBox Text1 
  19.       Height          =   380
  20.       Index           =   3
  21.       Left            =   2040
  22.       TabIndex        =   3
  23.       Top             =   2040
  24.       Width           =   1695
  25.    End
  26.    Begin TextBox Text1 
  27.       Height          =   380
  28.       Index           =   2
  29.       Left            =   2040
  30.       TabIndex        =   2
  31.       Top             =   1560
  32.       Width           =   1695
  33.    End
  34.    Begin TextBox Text1 
  35.       Height          =   380
  36.       Index           =   1
  37.       Left            =   2040
  38.       TabIndex        =   1
  39.       Top             =   1080
  40.       Width           =   1695
  41.    End
  42.    Begin TextBox Text1 
  43.       Height          =   380
  44.       Index           =   0
  45.       Left            =   2040
  46.       TabIndex        =   0
  47.       Top             =   600
  48.       Width           =   1695
  49.    End
  50.    Begin Label Label1 
  51.       Alignment       =   1  'Right Justify
  52.       Caption         =   "Shoe Size"
  53.       Height          =   260
  54.       Index           =   3
  55.       Left            =   840
  56.       TabIndex        =   7
  57.       Top             =   2160
  58.       Width           =   975
  59.    End
  60.    Begin Label Label1 
  61.       Alignment       =   1  'Right Justify
  62.       Caption         =   "Date of Birth"
  63.       Height          =   260
  64.       Index           =   2
  65.       Left            =   600
  66.       TabIndex        =   6
  67.       Top             =   1680
  68.       Width           =   1215
  69.    End
  70.    Begin Label Label1 
  71.       Alignment       =   1  'Right Justify
  72.       Caption         =   "Address"
  73.       Height          =   260
  74.       Index           =   1
  75.       Left            =   840
  76.       TabIndex        =   5
  77.       Top             =   1200
  78.       Width           =   975
  79.    End
  80.    Begin Label Label1 
  81.       Alignment       =   1  'Right Justify
  82.       Caption         =   "Name"
  83.       Height          =   260
  84.       Index           =   0
  85.       Left            =   840
  86.       TabIndex        =   4
  87.       Top             =   720
  88.       Width           =   975
  89.    End
  90.    Begin Label Label2 
  91.       Caption         =   "Put cursor in text boxes and press F1"
  92.       Height          =   260
  93.       Left            =   360
  94.       TabIndex        =   8
  95.       Top             =   120
  96.       Width           =   3255
  97.    End
  98. End
  99. Declare Function SetHook% Lib "hlpkey.dll" (ByVal hWnd As Integer)
  100. Declare Sub RemoveHook Lib "hlpkey.dll" ()
  101. Dim HelpMsg(4) As String
  102.  
  103. Sub form_Keypress (Keyascii As Integer)
  104. MsgBox HelpMsg(Screen.ActiveControl.TabIndex), 0, "HLPKEY F1 Hook DEMO"
  105. End Sub
  106.  
  107. Sub Form_Load ()
  108. HelpMsg(0) = "Enter your full name"
  109. HelpMsg(1) = "Enter your street address"
  110. HelpMsg(2) = "Enter your date of birth"
  111. HelpMsg(3) = "Enter shoe size"
  112. i% = SetHook(hWnd)
  113. End Sub
  114.  
  115. Sub Form_Unload (Cancel As Integer)
  116. RemoveHook
  117. End Sub
  118.  
  119.